home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume91 / shells / cshel500 / part06 < prev   
Encoding:
Internet Message Format  |  1991-03-03  |  37.2 KB

  1. Path: news.larc.nasa.gov!amiga-request
  2. From: amiga-request@ab20.larc.nasa.gov (Amiga Sources/Binaries Moderator)
  3. Subject: v91i032: CShell 5.00 - alternative command interface, Part06/06
  4. Reply-To: <umueller@iiic.ethz.ch>
  5. Newsgroups: comp.sources.amiga
  6. Message-ID: <comp.sources.amiga:v91i032@ab20.larc.nasa.gov>
  7. References: <comp.sources.amiga:v91i027@ab20.larc.nasa.gov>
  8. Date: 03 Mar 91 21:56:07 GMT
  9. Approved: tadguy@uunet.UU.NET (Tad Guy)
  10. X-Mail-Submissions-To: amiga@uunet.uu.net
  11. X-Post-Discussions-To: comp.sys.amiga.misc
  12.  
  13. Submitted-by: <umueller@iiic.ethz.ch>
  14. Posting-number: Volume 91, Issue 032
  15. Archive-name: shells/cshell-5.00/part06
  16.  
  17. #!/bin/sh
  18. # This is a shell archive.  Remove anything before this line, then unpack
  19. # it by saving it into a file and typing "sh file".  To overwrite existing
  20. # files, type "sh file -c".  You can also feed this as standard input via
  21. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  22. # will see the following message at the end:
  23. #        "End of archive 6 (of 6)."
  24. # Contents:  shell.doc.aa
  25. # Wrapped by tadguy@ab20 on Sun Mar  3 16:56:02 1991
  26. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  27. if test -f 'shell.doc.aa' -a "${1}" != "-c" ; then 
  28.   echo shar: Will not clobber existing file \"'shell.doc.aa'\"
  29. else
  30. echo shar: Extracting \"'shell.doc.aa'\" \(34966 characters\)
  31. sed "s/^X//" >'shell.doc.aa' <<'END_OF_FILE'
  32. X
  33. X        INSTRUCTIONS FOR SHELL VERSION: 5.00 17-Feb-91
  34. X        ==============================================
  35. X
  36. X  Contents
  37. X  --------
  38. X
  39. X    O.    Installation
  40. X    I.    Description
  41. X    II.    Overview of Major features
  42. X    III.    Restrictions
  43. X    IV.    PIPES
  44. X    V.    Command Pre-processor
  45. X    VI.    Command Line Editing
  46. X    VII.    Function Keys
  47. X    VIII.    Shell Commands
  48. X    IX.    Special Set Variables
  49. X    X.    Functions
  50. X    XI.    Miscellaneous
  51. X    XII.    Example source files
  52. X    XIII.    Default values
  53. X    XIV.    Object oriented features
  54. X    XV.    Keymaps
  55. X
  56. X
  57. X
  58. XO.  Installation
  59. X----------------
  60. X
  61. XYou  can  simply  invoke  csh  from  the command line or at the end of your
  62. Xstartup-sequence,  because csh is, from the AmigaDOS standpoint, not a true
  63. Xshell  like  l:shell-seg.  Nevertheless, csh is 'pure', so if your archiver
  64. Xforgot  to  set  the  'p'  bit,  do  it right now. 
  65. X
  66. XIn order to run simple AmigaDOS batch files, you must make sure that they
  67. Xdon't use arguments (.key, .bra stuff), and you must replace ';' by ';#',
  68. Xso comments are comments both to AmigaDOS and CShell.
  69. X
  70. XProposed final setup:  If you want to make csh resident, do the following:
  71. X
  72. XKickstart 1.3
  73. X1. Copy csh anywhere on your (hard)disk, e.g. dh1:tools
  74. X2. Make sure your s:startup-sequence contains:
  75. X    Resident CLI L:Shell-Seg SYSTEM PURE ADD
  76. X    Resident dh1:tools/csh ADD
  77. X    NewCLI FROM s:csh-startup
  78. X    EndCLI
  79. X3. Put the following in s:csh-startup
  80. X    csh -r s:firstlogin.sh
  81. X4. In s:firstlogin.sh, put any commands to be called only once, like setmap,
  82. X   assign, setclock. This is a shell script, use # for comments, and don't
  83. X   use .key type commands. At the end of this file, add
  84. X    source s:login.sh
  85. X5. In s:login.sh, you put any commands that need to be invocated on every
  86. X   invocation, like 'alias', 'set' and so on.
  87. X6. Put the following the s:cli-startup and s:shell-startup, so csh will be
  88. X   started in any window opened by NewCLI or from workbench.
  89. X    csh s:login.sh
  90. X
  91. XKickstart 2.0
  92. X1. Copy csh anywhere on your (hard)disk, e.g. dh1:tools
  93. X2. Make sure your s:startup-sequence contains:
  94. X    Resident dh1:tools/csh ADD
  95. X    csh s:firstlogin.sh
  96. X3. Proceed from step 4 in kickstart 1.3
  97. X
  98. X
  99. X
  100. XI.  DESCRIPTION
  101. X---------------
  102. X
  103. XThis version of Shell is the follow of:
  104. X    Shell V2.04 (C)Copyright 1986, Matthew Dillon, All Rights Reserved
  105. X    Shell V2.04M-V2.07M by Steve Drew
  106. X    Shell V2.08MI, V3.xxA and V4.xxA by Carlo Borreo & Cesare Dieni
  107. X    Shell V5.0x (and V4.9x) by Urban Mueller
  108. X
  109. XIf you have any wishes, bug reports or beer bottles, send them to:
  110. X
  111. X       FIDONET: AUGL BBS, 2:302/906
  112. X       USENET:  umueller@iiic.ethz.ch
  113. Xor
  114. X       Urban Mueller
  115. X       Schulhausstrasse 83
  116. X    CH-6312 Steinhausen
  117. X       SWITZERLAND
  118. X
  119. XPlease   check  the  'restrictions'  and  'known  bugs'  paragraphs  before
  120. Xreporting  any  bugs.  The support BBS is AUGL, +41 75 8 20 19, +41 75 8 20
  121. X18,   +41   75   2   15  87  (all  lines  USRobotics  HST)  login='cshell',
  122. Xpassword='support'
  123. X
  124. XFor versions prior to 4.9 send suggestions/criticism/anything else to Carlo
  125. XBorreo or Cesare Dieni at:
  126. X
  127. X       BITNET:  PERUGIA@ICNUCEVM.BITNET
  128. X       FIDONET: 2:332/602.0@FIDONET
  129. Xor
  130. X       Carlo Borreo            Cesare Dieni
  131. X       Via G. Berio 34        Via G. Taddei 3
  132. X       I-18100 Imperia        I-56100 Pisa
  133. X       Italy            Italy
  134. X
  135. XYou may distribute this program unmodified and for non-profit only.
  136. X
  137. X*** YOU MAY NOT MODIFY THIS PROGRAM AND REDISTRIBUTE IT ***
  138. X
  139. XIf  everyone  writes his own version of Shell and distributes it, we would be
  140. Xcovered  by  Shell  versions.   If  you make a modification to Shell that you
  141. Xwould  like  to  share  with  other users, please send us a DIFF output, or a
  142. Xdescription of what you need.
  143. X
  144. XACKNOLEDGEMENTS
  145. X---------------
  146. X
  147. XArexx is a program by William Hawes.
  148. XCygnus Ed Professional (C) 1988 CygnusSoft Software.
  149. X
  150. X
  151. XII. OVERVIEW
  152. X------------
  153. X
  154. XShell  provides a convenient AmigaDos alternative command interface.  All its
  155. Xcommands  are  internal  and  thus  does not rely on the c:  commands for any
  156. Xfunctionality.
  157. X
  158. XMajor features include:
  159. X    - command line editing
  160. X    - simple history
  161. X    - piping
  162. X    - aliases with arguments
  163. X    - variables & variable handling (embedded variables)
  164. X    - file name expansion via wild carding ('?', '*' and more)
  165. X    - conditionals (if/else etc..)
  166. X    - source files  (w/ gotos and labels)
  167. X    - tab file name completion
  168. X    - object oriented features (file classes, actions)
  169. X    - many built in commands to speed things up
  170. X    - full functionality on VT terminals
  171. X    - freely programmable command line editing
  172. X
  173. XShell  runs  on  minimum stack, for recursive aliases and source files better
  174. Xincrease stack to 8K or more.
  175. X
  176. XIf you use CShell for the first time, remember the following:
  177. X    - CShell internal commands must be lowercase & can be abbreviated
  178. X    - AmigaDOS command 'Execute' does not work, sorry. Use 'Newcli FROM',
  179. X      'run Execute' or slightly rewrite your scripts, so you can 'source'
  180. X      them. Besides the '.'-Commands (.key,.bra), 'source' is downward
  181. X      compatible to 'Execute'.
  182. X    - You can always get more information on a command if shell.doc is
  183. X      in the current directory (you will be able to modify this) and
  184. X      you enter 'man <command>'
  185. X
  186. X
  187. XIII. RESTRICTIONS
  188. X-----------------
  189. X
  190. XResident AmigaDOS 2.0 CLI commands currently shouln't be started, even if you
  191. Xmake them resident yourself.  According to a commodore official, this problem
  192. Xshould  be  fixed in the final kickstart 2.0 release.  All INTERNAL residents
  193. Xare  disabled  for  that reasons.  If you have a kickstart version newer than
  194. X37.21, you might try to use the startup option -i, which enables the internal
  195. Xresidents.  All other AmigaDOS residents can be started under DOS 2.0.
  196. X
  197. XUnder  1.3,  you  can't  start  AmigaDOS  residents.   But you can use the -r
  198. Xstartup  option,  which  will  copy  the  AmigaDOS  resident  list to the arp
  199. Xresident  list  once (and make those residents unremovable).  I try to find a
  200. Xbetter solution.
  201. X
  202. XThe  best  choice  is  to  make  only csh itself AmigaDOS resident, all other
  203. Xcommands,  if  any, ARP resident.  Under 1.3, you can start the shell (as all
  204. Xother  commands)  from resident only after you did 'resident CLI l:Shell-seg'
  205. Xand 'newcli'.
  206. X
  207. XVDK  handler has a bug with setting file dates so when using the copy command
  208. Xand  VDK  you should use the -d switch otherwise your file date in vdk:  will
  209. Xbe bad.  (This is not a shell bug)
  210. X
  211. XIf using with conman it you may consider starting shell with the -a switch to
  212. Xturn  off shell's command line editing and use conmans instead.  You'll lose,
  213. Xhowever, many shell features like TAB file name completion.
  214. X
  215. XCB-handler  (a  tool that installs a scrollbar in the CLI window) is not 100%
  216. Xcompatible with the shell.  The log will not always represent the true screen
  217. Xcontents.
  218. X
  219. X
  220. X
  221. XIV. NOTES ON PIPES
  222. X------------------
  223. X
  224. X    PIPES
  225. X    PIPES  have  been implemented using temporary T:  files.  Thus, you
  226. X    should be  careful  when  specifying  a 't:*' expansion as it might
  227. X    include the temporary files. These files are deleted on completion
  228. X    of the pipe segment.
  229. X
  230. X    The file names used are completely unique, even with multiple shell
  231. X    running simultaneously.
  232. X
  233. X    My  favorite  new  feature is the fact that you can now redirect to
  234. X    and  from,  and pipe internal commands.  'echo charlie >ram:x', for
  235. X    instance.  Another favorite:
  236. X
  237. X    echo "echo mem | csh" | csh
  238. X
  239. X    NO BCPL program should be output-append redirected (>>).
  240. X
  241. X
  242. XV.  COMMAND PRE-PROCESSOR
  243. X-------------------------
  244. X
  245. X    PREPROCESSING
  246. X    Preprocessing is done on the command line before it is passed on to
  247. X    an internal or external routine:
  248. X
  249. X    ^c    where c is a character is converted to that control character.
  250. X        Thus, say '^l' for control-l.
  251. X
  252. X    \233    insert character code 233 octal. Do not use values between
  253. X        200o and 232o, as they have special meanings. \240 is the
  254. X        word separator.
  255. X
  256. X    $name    where name is a variable name.  Variable names can consist of
  257. X        0-9, a-z, A-Z, and underscore (_).  The contents of the
  258. X        specified variable is used.  If the variable doesn't exist,
  259. X        the specifier is used.  That is, if the variable 'i' contains
  260. X        'charlie', then '$i' -> 'charlie'.  If the variable 'i' doesn't
  261. X        exist, then '$i'->'$i' .
  262. X
  263. X    ;    delimits commands.   echo charlie ; echo ben.
  264. X
  265. X    ' '    (a space). Spaces delimit arguments.
  266. X
  267. X    "string" a quoted string. Trailing quotes are optional. For instance,
  268. X        if you want to echo five spaces and an 'a':
  269. X
  270. X        echo      a       -> a
  271. X        echo "    a"      ->      a
  272. X
  273. X    \c    overide the meaning of special characters.  '\^a' is a
  274. X        circumflex and an a rather than control-a.  To get a backslash,
  275. X        you must say '\\'.
  276. X
  277. X        also used to overide alias searching for commands.
  278. X
  279. X    >file    specify output redirection.  All output from the command is
  280. X        placed in the specified file.
  281. X
  282. X    >>file    specify append redirection (Does not work with BCPL programs).
  283. X
  284. X    <file    specify input redirection. The command takes input from the
  285. X        file rather than the keyboard (note: not all commands require
  286. X        input; it makes no sense to say 'echo <charlie' since
  287. X        the 'echo' command only outputs its arguments).
  288. X
  289. X    |    PIPE specifier.  The output from the command on the left becomes
  290. X        the input to the command on the right.  The current SHELL
  291. X        implimentation uses temporary files to store the data.
  292. X
  293. X    !!    execute the previously executed command.
  294. X    !nn    (nn is a number).  Insert the history command numbered n (see
  295. X        the HISTORY command)
  296. X    !partial search backwards through the history list for a command which
  297. X        looks the same as 'partial', and execute it.
  298. X
  299. X    #    Enter comment.  The rest of the line is discarded (note: \#
  300. X        will, of course, overide the comment character's special
  301. X        meaning)
  302. X
  303. X
  304. XVI. COMMAND LINE EDITING
  305. X------------------------
  306. X
  307. X    o Command line can be up to 255 chars.
  308. X    o Inserts  and  deletes  are handled correctly over multiple screen
  309. X      lines.
  310. X    o Shell  will  keep  track  of the line width should the window get
  311. X    resized.
  312. X
  313. X    EDITING
  314. X
  315. X    -- MOVING --
  316. X    Left Arrow      One character left
  317. X    Right Arrow      One character right
  318. X    Shift-Left Arrow  One word left
  319. X    Shift-Right Arrow One word right
  320. X    ESC-Left Arrow      Beginning of line (^A) (^Z)
  321. X    ESC-Right Arrow      End of line       (^E)
  322. X    -- DELETING --
  323. X    Backspace      Previous character
  324. X    Del          Character under cursor
  325. X    ESC-Backspace      Previous word     (^W)
  326. X    ESC-Del          Next word    
  327. X    ESC-x-Backspace      To start of line  (^B)
  328. X    ESC-x-Del      To end of line    (^K)
  329. X    ESC-d          Entire line       (^X)
  330. X    -- HISTORY --
  331. X    Up Arrow      Recall previous commands
  332. X    Down Arrow      Recall commands
  333. X    Shift-Up Arrow      Get start of history
  334. X    Shift-Down Arrow  Get end of history
  335. X    ESC-!          Get history from partial (or number)
  336. X    ^T          Insert tail (all but first word) of previous line
  337. X    -- COMPLETION --
  338. X    TAB          Inserts first matching file name
  339. X    Shift-TAB      Inserts longest common substring
  340. X    ESC-TAB          Inserts all matching file names
  341. X    ESC-c          Does a quick cd on left word (TAB for cycling)
  342. X    ESC-~          Inserts the last current directory
  343. X    -- EXECUTING LINE --
  344. X    Return          Executes line
  345. X    ESC-Return      Executes this line of history & brings up next one
  346. X    ^N          Next line. Don't exec this one but store history
  347. X    ^\          EOF (directly exits)
  348. X    -- MISCELLANEOUS --
  349. X    ^L          Retype current line.
  350. X    ^O          Echo a ^O
  351. X    ^R          Repeat last command (don't play with this)
  352. X    ^U          Undo/Redo last edit 
  353. X    ESC-i          Toggle Insert/Overwrite
  354. X    f1-f10          Execute command if variable exists.
  355. X    F1-F10          More commands (Shifted f keys).
  356. X    Help          Invokes help command
  357. X
  358. XWhenever  the cursor is placed on or directly after an incomplete file name
  359. Xand   you  press  TAB,  CShell  inserts  for  the  first  filename  (sorted
  360. Xalphabetically)  that  matches  the name part already typed.  Any wildcards
  361. Xare allowed here, if none are given, '*' is appended.  Immediately pressing
  362. XTAB  again  brings  up  the  next  file  name  that  matched the substring.
  363. XShift-TAB  will  only  insert  the  as  much as is common to all files that
  364. Xmatched  you  abbreviation.   If  pressed  again,  behaves  just  like TAB.
  365. XESC-Tab  inserts  the  name  of the directory where you would have ended up
  366. Xwith a quick cd to that substring.
  367. X
  368. XNote  that  ^D  now  means  'quit  batchfile' like under AmigaDOS and is no
  369. Xlonger used for quitting CShell. If you want it back, enter 'keymap 0 4=41'
  370. X
  371. XThe  CTRL  keys FGPVY are unset, feel free to map them to any function (see
  372. Xchapter XV).  You can also remap all preset keys.
  373. X
  374. XVII. FUNCTION KEYS
  375. X------------------
  376. X
  377. X    FUNKEY
  378. X    Function keys now insert text to the current position on the command
  379. X    line. They maybe terminated with a ^M (return). f1 would be non shifted
  380. X    where as F1 is shifted.
  381. X    Most of functions key have a default definition, but it may be changed.
  382. X
  383. X        $ set f1 dir df0:^M
  384. X
  385. X    will add the text 'dir df0:<return>' to the current line.
  386. X
  387. X        $ set f1 dir
  388. X
  389. X    would only add 'dir' you could then enter ' df0:<return>'
  390. X
  391. X
  392. XVIII. SHELL COMMANDS
  393. X--------------------
  394. X
  395. X    STARTUP OPTIONS
  396. X    First to start shell from a CLI:
  397. X
  398. X    shell [-abkntv] [-c command;command]
  399. X
  400. X     -a AUX: mode. No command line editing and text highlighting
  401. X     -b starts shell in background, which means only task priority -1.
  402. X     -c allows execution of one command line and then exits out
  403. X        of  shell.   This  is  useful for running an internal shell
  404. X        commands in the background or from an external application:
  405. X        Run csh -c dir df0:; copy -r df0: df1: >nil:; echo Done
  406. X     -f starts shell in foreground, which means only task priority 1.
  407. X        you should reset this prioritiy to 0 at the end of your .login
  408. X     -k sets _nobreak before doing anything
  409. X     -n suppresses starting of s:.login
  410. X     -r copies the amiga resident list to the arp resident list. You
  411. X        can't remove them anymore. INTERNAL residents can't be copied.
  412. X        This option will be ignored under kickstart 2.0
  413. X     -t terminal mode. You can use command line editing and text high-
  414. X        lighting on a VT100 compatible terminal.
  415. X     -v sets _verbose before doing anything.
  416. X
  417. X    Under 1.3, the best thing you can do is to make csh resident using
  418. X    the AmigaDOS Resident command in the startup-sequence, then start
  419. X    it with the option -r, so you can start another resident csh from
  420. X    inside csh. NOTE: Residents copied using -r cannot be removed! I
  421. X    advise you to use the internal resident command for all but csh
  422. X    itself.
  423. X
  424. X    COMMAND EXECUTION
  425. X
  426. X    Internal shell commands are case sensitive and may be abreviated.
  427. X
  428. X   The first argument is the command-name... here is (in order) how Shell
  429. X   tries to execute it:
  430. X
  431. X    1)  Alias list is searched for an alias exactly matching name.
  432. X    2)  Internal commands list is scanned for a command even partially
  433. X        matching name (so you can, for instance, say resi for resident;
  434. X        however, you should specify enough of a command to be unique).
  435. X    3)  Then, the list of functions is scanned for a command that
  436. X        matches completely. If one is found, the result of the function
  437. X        is echoed to stdout.
  438. X    4)  AmigaDOS and ARP resident list are scanned (you can use Shell's
  439. X        resident command to add/remove a file in the ARP list).
  440. X    5)  At this point, command is supposed to be external (disk).
  441. X    6)  If the file is a directory, a 'cd' is performed to it.
  442. X    7)  If the file is in the current directory and it's executable, it
  443. X        is started. If not executable but has the 's' bit set, it's
  444. X        'source'd.
  445. X    8)  Then it is searched in the AmigaDOS path and c:
  446. X    9)  Now, the shell path ($_path) is searched. If it's found and 
  447. X        executable, it's be started. If it has the 's' bit set, it will
  448. X        be 'source'd.
  449. X    10) Next, AUTOMATIC SOURCING is tried, first in current directory,
  450. X        then in Shell path.
  451. X    11) Then the variable _rxpath is examined. If it exists, and the
  452. X        current file with the suffix .rexx exists in one of the
  453. X        directories specified in _rxpath, 'RX <file>' is executed.
  454. X    12) If all failed, an 'exec' action is sent to the file. See chapter
  455. X        XIV for more info on classes and actions.
  456. X
  457. X    To enforce that the external 'dir'-command is used, enter 'Dir'. Tt
  458. X    is a good habit to uppercase the first letter of all external com-
  459. X    mands, even if this is not necessary.
  460. X
  461. X    AUTOMATIC SOURCING may be accomplished by naming shell scripts with
  462. X    a  .sh  suffix.   Thus,  if you say 'stuff' and the file 'stuff.sh'
  463. X    exists in your current or anywhere in Shell search path (NOTE: won't
  464. X    be found in the AmigaDOS path), it will be SOURCED  with all arguments
  465. X    you  have given placed  in  the  $_passed variable. This is equivalent
  466. X    to typing 'source stuff.sh'
  467. X
  468. X    WILD CARD EXPANSION
  469. X    Most shell commands will accept multiple arguments that can
  470. X    be as a result of wild card expansion.  Also when calling
  471. X    an external command shell will first expand any wild cards
  472. X    to separate arguments.  If you wish to have the external command
  473. X    handle it's own wild carding you will need to insert quotes
  474. X    around the special wild card characters or use an alias (see
  475. X    explanation of 'alias')
  476. X
  477. X    eg.
  478. X        arc a new.arc *.txt    - shell will expand and pass to arc
  479. X        arc a new.arc "*.txt"    - let arc expand the wild cards.
  480. X        alias arc "*a Arc $a"    - now shell will never expand
  481. X
  482. X    Wildcards allowed:
  483. X
  484. X    ?    match any single character
  485. X    *    match any string
  486. X    .../*    recursive search down ALL sub directories from current level
  487. X    ~    exclude pattern matching specifier
  488. X    !    synonim for ~, supported for compatibility
  489. X    &    prefixed to patterns, ask confirmation for each file
  490. X    []    character class
  491. X    ~    the previous current directory
  492. X    Note that a pattern must contain a '?' or a '*', otherwise the other
  493. X    special characters are not recognized. Furthermore, you cannot spe-
  494. X    cify a single '?' as a pattern in the first argument to a command,
  495. X    as this will show you the usage of that command.
  496. X
  497. X    Examples:
  498. X
  499. X    df0:.../*        all files in all directories on df0:
  500. X    df0:.../!*.info     full directory tree of df0: but exclude
  501. X                any ugly .info files.
  502. X    !*.o !*.c        will result in ALL files matching since what
  503. X                doesn't match the !*.o will match the !*.c
  504. X    df1:&*            all files in root of df1:, but ask 
  505. X                confirmation for each
  506. X    *.[co]            all files ending in .c or .o
  507. X    ~*.[co]            all files NOT ending in .c nor in .o
  508. X    ~/readme        the readme from your last current directory
  509. X
  510. X    Note that some commands prevent wild card expansion. These are:
  511. X      - dir, rpn, whereis, window
  512. X    Those commands will expand the wild cards themselves. This is why
  513. X      dir @without( *.? , *.o )
  514. X    will not work. Instead use:
  515. X      set arg @without( *.? , *.o );dir $arg
  516. X
  517. X    There is one exception to the rules given above: A single '?' as
  518. X    the first argument will *not* expand in order to allow you to get
  519. X    the usage of CLI and csh commands easily.
  520. X
  521. X    The   following   symbols  are  not  yet  supported  by  wild  card
  522. X    expansions, but are accepted in search -w:
  523. X
  524. X    ( | )    OR matching
  525. X    #    0 or more times the pattern following
  526. X
  527. X    Examples:
  528. X
  529. X    "k#a"        matches ka, kaa, kaaa, etc.
  530. X    "hel(lo|p)"    matches hello or help.
  531. X
  532. X
  533. XLIST OF COMMANDS:
  534. X-----------------
  535. X
  536. X    ABORTLINE
  537. X    Usage    : abortline
  538. X    Example    : echo a;abort;echo b
  539. X    Results    : a
  540. X
  541. X    Causes the rest of the line to be aborted. Intended for use in
  542. X    conjunction with exception handling.
  543. X
  544. X    ACTION
  545. X    Usage    : action [-a] actionname file [arguments]
  546. X
  547. X    Sends an action to a file. See chapter XIV CLASSES
  548. X    Options:
  549. X     -a (abort) returns 0 if failed and 1 if successful. Otherwise,
  550. X                normal error codes (10 or 11) are returned
  551. X
  552. X    ADDBUFFERS
  553. X    Usage    : addbuffers drive buffers [drive buffers ...]
  554. X    Example    : addbuffers df0: 24
  555. X
  556. X    Just like AmigaDOS addbuffer command, causes new buffers to be
  557. X    allocated for disk I/O. Each buffer costs 512 bytes of memory,
  558. X    CHIP memory if a disk drive.
  559. X
  560. X    ALIAS
  561. X    Usage    : alias [name [command string] ]
  562. X    Example    : alias vt "echo Starting VT100;run sys:tools/vt100"
  563. X
  564. X    Sets a name to be a string. You can alias a single name to a set
  565. X    of commands if you enclose them in quotes as above. By simply
  566. X    typing vt, the command line above would be executed.
  567. X
  568. X    Argument Passing to an Alias:
  569. X
  570. X    Usage    : alias name "%var[%var...] [ command_string ]"
  571. X          alias name "*var[%var...] [ command_string ]"
  572. X    Example    : alias xx "%q%w echo hi $q, you look $w
  573. X          xx Steve great today
  574. X    Results    : hi Steve, you look great today
  575. X
  576. X    The second form of the alias command allows passing of arguments
  577. X    to any position within the command string via use of a variable
  578. X    name. To pass arguments to the end of a command string this method
  579. X    is actually not necessary. Note that these variables are not (yet)
  580. X    local, so make sure don't destroy another variable.
  581. X    If you specify multiple arguments, every argument will be assigned
  582. X    one word, and the last one will be assigned the rest of the command
  583. X    line.
  584. X
  585. X    Using a '*' instead of the first '%' prevents wild card expansion:
  586. X        alias zoo "*a zoo $a
  587. X    To expand the wild cards after you got them, use
  588. X        exec set a $a
  589. X
  590. X    By typing "alias name", you will get the alias for that name, while
  591. X    with "alias" you get a list of all alias.
  592. X
  593. X    ASCII
  594. X    Usage    : ascii
  595. X          ascii string
  596. X
  597. X    If called without arguments, ascii outputs a complete ascii table.
  598. X    Given a string, shows each character in ascii. Options:
  599. X      -h shows numbers in hexadecimal
  600. X      -o shows numbers in octal
  601. X
  602. X    ASET
  603. X    Usage    : aset name value
  604. X    Example    : aset INCLUDE include:
  605. X
  606. X    Set a variable in a way that is compatible with ARP/old Aztec set
  607. X    command; this is completely different from ENV: Shell variable.
  608. X
  609. X    ASSIGN
  610. X    Usage    : assign
  611. X          assign logical
  612. X          assign [-ln] logical1 physical1 [logical2 physical2 ... ]
  613. X
  614. X    The first form shows all assigns.
  615. X    The second form kills one assign.
  616. X    The third form assigns logical1 to physical1 and so on. Options:
  617. X     -l creates a late-binding assign under kick 2.0, ignored otherwise
  618. X     -n creates a non-binding assign under kick 2.0, ignored otherwise
  619. X    For definition of late/nonbinding, refer to your AmigaDOS manual.
  620. X
  621. X    BASENAME
  622. X    Usage    : basename var path
  623. X    Example    : basename x df0:c/Dir    # sets x to "Dir"
  624. X
  625. X    Sets var specified to basename of path.
  626. X
  627. X    CAT
  628. X    Usage    : cat [-n][file file....]
  629. X    Example    : cat foo.txt
  630. X
  631. X    Type the specified files onto the screen.  If no file is specified,
  632. X    STDIN in used (note: ^\ is EOF).  CAT is meant to output text files
  633. X    only. Specifying -n option you will get numbered lines.
  634. X
  635. X    CD
  636. X    Usage    : cd [path]
  637. X          cd -g device1 [device2 [device3 ...]]
  638. X
  639. X    Change your current working directory.  You may specify '..' to go
  640. X    back one directory (this is a CD specific feature, and does not
  641. X    work with normal path specifications).
  642. X
  643. X    In most cases, you'll no more have to use the CD command. Just type
  644. X    the desired directory at the prompt (very handy in conjunction with
  645. X    file name completion). Typing a ~ alone on a command line cd's
  646. X    to prevous current directory.
  647. X
  648. X    There are two situations left when you still need it:
  649. X
  650. X    Entering 'cd *tem' will cd to the first name matched.
  651. X
  652. X    The second form generates a list (an ascii file) of all direc-
  653. X    tories on the given devices. It will be stored in the file given
  654. X    in $_qcd (default: 'S:csh-qcd'). Note that this ascii file  will
  655. X    not be merged but overwritten. Once you have generated this file,
  656. X    you can cd to any directory on your harddisk(s) even if it's not
  657. X    in the current directory.
  658. X    If you have two directories of the same name and you use one of
  659. X    them more, move the more important one to the beginning of the
  660. X    qcd file. You might also sort the file.
  661. X    It is legal to type just an abbreviation of the directory name
  662. X    you want to cd to. No asterisk '*' necessary. If you end up in
  663. X    the wrong directory, cd to the same directory again (best done
  664. X    by Cursor-Up + RETURN). You will cycle through all directories
  665. X    that matched the given abbreviation. The other possibility is to
  666. X    specify the full name of the parent directory: cd devs/keym
  667. X    You may also add devices and assigns, so if 'PageStream:' is one
  668. X    line in the qcd-file, a cd to 'page' is successful.
  669. X
  670. X    CD without any arguments displays the path of the directory you
  671. X    are currently in.
  672. X
  673. X    CLASS
  674. X    Usage    : [-n] name {type=param} [ "actions" {action=command} ]
  675. X    Example : class zoo offs=20,dca7c4fd ext=.zoo actions view="zoo l"
  676. X
  677. X    Defines a new class of files and the actions to be taken on them
  678. X    in various cases, or shows old definitions if given no arguments.
  679. X    See section XIV: OBJECTS
  680. X    Options:
  681. X      -n (new)  forgets old definitions
  682. X
  683. X
  684. X    CLOSE
  685. X    Usage    : close [filenumber]
  686. X
  687. X    Close the specified file opened by open. Without filenumber, closes
  688. X    all open files. See open and flist for more info.
  689. X
  690. X    CLS
  691. X    Usage    : cls
  692. X
  693. X    This is an alias. It only clears the screen, but also works on a
  694. X    terminal (e ^L doesn't).
  695. X
  696. X    COPY (CP)
  697. X    Usage    : copy [-udfp]  file file
  698. X    or    : copy [-udfp]  file1 file2...fileN dir
  699. X    or    : copy [-rudfp] dir1...dirN file1...fileN dir
  700. X
  701. X    Options    :
  702. X      -r recursive, copy all subdirectories as well.
  703. X      -u update, if newer version exists on dest, don't copy
  704. X      -f freshen, if file doesn't exist on dest or newer, don't copy
  705. X      -d don't set destination file date to that of source.
  706. X      -p don't set destination protection bits to those of source.
  707. X
  708. X    Example    : copy -r df0: df1:
  709. X
  710. X    Copy files or directories. When copying directories, the -r option
  711. X    must be specified to copy subdirectories as well.  Otherwise, only
  712. X    top level files in the source directory are copied.
  713. X
  714. X    All files will be displayed as they are copied and directory's
  715. X    displayed as they are created. This output can be suppessed by
  716. X    redirecting to nil: eg. copy -r >nil: df0: df1:
  717. X
  718. X    Copy will abort after current file on Control-C.
  719. X
  720. X    Copy by default sets the date of the destination file to that of
  721. X    the source file. To overide this feature use the -d switch.
  722. X
  723. X    Similarly, it sets protection bits (flags) to those of source and
  724. X    any file comment will be copied. To avoid this use -p. The archive
  725. X    bit is always cleared.
  726. X
  727. X    Another useful option is the -u (update) mode were copy will not
  728. X    copy any files which exists already in the destination directory
  729. X    if the destination file is newer or equal to the source file.
  730. X    This is useful when developing code say in ram: eg. 'copy *.c ram:'
  731. X    when done you can copy -u ram: df1: and only those modules you have
  732. X    modified will be copied back.
  733. X
  734. X    Copy command will now create the destination directory if it does
  735. X    not exist when specified as 'copy [-r] dir dir'. If you specify
  736. X    copy file file file dir, then 'dir' must already exist.
  737. X
  738. X    CP
  739. X    Equivalent to copy.
  740. X
  741. X    DATE
  742. X    Usage    : date [-sr] [new date and/or time]
  743. X    Example    : date Wednesday  # this refers to NEXT wed, of course
  744. X
  745. X    Used to read or set system date and/or time. All standard options
  746. X    may be used (yesterday, tomorrow, monday, etc.).
  747. X    Leading zero's are not necessary.
  748. X    Without parameters shows Dddddd DD-MMM-YY HH:MM:SS.
  749. X    Options:
  750. X      -s stores the current time
  751. X      -r shows time relative to last stored in secs and hunderths
  752. X
  753. X    DEC
  754. X    Usage    : dec varname [value]
  755. X    Example    : dec abc
  756. X
  757. X    Decrement the numerical equivalent of the variable with specified
  758. X    value (default: 1) and place the ASCII-string result back into
  759. X    that variable.
  760. X
  761. X    DELETE (RM)
  762. X    Usage    : delete [-p][-r] file file file...
  763. X    Example    : delete foo.txt test.c
  764. X
  765. X    Remove (delete) the specified files.  Remove always returns
  766. X    errorcode 0.  You can remove empty directories.  The '-r' option
  767. X    will remove non-empty directories by recursively removing all sub
  768. X    directories.
  769. X    You can remove delete-protected files specifying -p option.
  770. X    If you specify any wildcard deletes the files will be listed as
  771. X    they are deleted. This can be suppressed by redirecting to nil:
  772. X
  773. X    DIR     (LS)
  774. X    Usage    : dir [-abcdfhiklnoqstuv] [path path ... ]
  775. X    Example    : dir -ts downloads:
  776. X
  777. X    Options:
  778. X     -d list directories only
  779. X     -f list files only
  780. X     -h list only files which not start with a dot, end with '.info' or
  781. X        have the h-flag set.
  782. X     -s short multi(4) column display.
  783. X     -c don't change colors for directories
  784. X     -q quiet display. does not show length in blocks
  785. X     -o display file nOtes
  786. X     -n display names only
  787. X     -a shows the age of all files in the format  days hours:minutes
  788. X     -i identifies every file, shows the type instead of the date.
  789. X        See chapter XIV CLASSES
  790. X     -v (viewdir) recursively sums up lengths of the files in a dir
  791. X     -l sorts the files by their length, longest first.
  792. X     -t sorts the files by their time, most recent first.
  793. X     -k sorts the files by their class (klass)
  794. X     -b sorts the files backwards.
  795. X     -u must be given exactly two directories. Shows files only in
  796. X        the first directory, files in both and files in the second.
  797. X
  798. X    Displays a directory of specified files. Default output shows
  799. X    date, protection, block size, byte size and total space used.
  800. X    Protections flags include new 1.2/1.3 flags (see under protect),
  801. X    plus a 'c' flag which indicates that this file has a comment.
  802. X    Files are alphabetically sorted, without case sensitivity, and
  803. X    directories are in red pen (unless you use -c). Dir takes in
  804. X    account the width of your window.
  805. X
  806. X    DISKCHANGE
  807. X    Usage    : diskchange drive
  808. X
  809. X    Like AmigaDOS diskchange.
  810. X
  811. X    ECHO
  812. X    Usage    : echo [-en] string
  813. X    Example    : echo hi there
  814. X    Results    : hi there
  815. X
  816. X    Echo the string given. If -n switch given no newline is
  817. X    appended. If -e is on, echo to stderr.
  818. X
  819. X    ELSE
  820. X    Usage    : else ; command
  821. X    Usage    : if -f foo.c ; else ; echo "Not there" ; endif
  822. X
  823. X    Else clause, must follow an IF statement.
  824. X
  825. X    ENDIF
  826. X    Usage    : endif
  827. X
  828. X    The end of an if statement.
  829. X
  830. X    Note: if you return from a script file with unterminated IF's
  831. X    and the last IF was false, prompt will be changed to an
  832. X    underscore ('_') and no commands will be executed until
  833. X    'endif' is typed.
  834. X
  835. X    EXEC
  836. X    Usage    : exec command [args]
  837. X    Example    : set util SYS:sytem/utilities
  838. X          exec $util/make    # would not work without exec
  839. X
  840. X    Execute the command specified; exec command is equivalent to
  841. X    command, only you can use variables to specify command name.
  842. X    Note that the command line is parsed TWICE, so the commands
  843. X       set a dir ram:; exec $a              # right
  844. X    works fine, but
  845. X       set a mkdir; exec $a "My directory"  # wrong!
  846. X    would create two directories. Also note that exec always has
  847. X    the return value 0.
  848. X
  849. X    FAULT
  850. X    Usage    : fault error1 .. errorN
  851. X    Example    : fault 205 212
  852. X
  853. X    Like AmigaDOS fault, prints specified error messages.
  854. X
  855. X    FILENOTE
  856. X    Usage    : filenote file1 .. fileN  note
  857. X          filenote -s file1...fileN
  858. X
  859. X    The first form sets AmigaDOS comment of the specified file.
  860. X    The second form display the file notes of the given files.
  861. X
  862. X    FLIST
  863. X    Usage    : flist
  864. X
  865. X    Lists the filenumbers of files opened by open.
  866. X    See open and close for more info.
  867. X
  868. X    FLTLOWER
  869. X    Usage    : fltlower
  870. X    Example    : dir | fltlower
  871. X    Or    : fltlower <readme
  872. X
  873. X    This is a filter command, i.e. it reads from stdin and writes to
  874. X    stdout. The more natural way to use it is a pipe, or it can be
  875. X    redirected.
  876. X    Its purpose is to convert all alphabetic to lower case.
  877. X
  878. X    FLTUPPER
  879. X    The same of fltlower, only this converts to upper case.
  880. X
  881. X    FOREACH
  882. X    Usage    : foreach [-v] varname ( strings ) command
  883. X    Example    : foreach i ( a b c d ) "echo -n $i;echo \" ha\""
  884. X    Result    : a ha
  885. X          b ha
  886. X          c ha
  887. X          d ha
  888. X
  889. X    'strings' is broken up into arguments.  Each argument is placed in
  890. X    the variable 'varname' in turn and 'command' executed.  To execute
  891. X    multiple commands, place them in quotes.
  892. X
  893. X    Foreach is especially useful when interpreting passed arguments in
  894. X    an alias.
  895. X
  896. X    eg.
  897. X        foreach i ( *.pic ) viewilbm $i
  898. X    assuming a.pic and b.pic in current directory the following commands
  899. X    will occur:
  900. X        viewilbm a.pic
  901. X        viewilbm b.pic
  902. X
  903. X    Flag -v causes arguments to be displayed every time command is
  904. X    executed.
  905. X
  906. X    FOREVER
  907. X    Usage    : forever command
  908. X    or    : forever "command;command;command..."
  909. X
  910. X    The specified commands are executed over and over again forever.
  911. X
  912. X    -Execution stops if you hit ^C
  913. X    -If the commands return with an error code.
  914. X
  915. X    FORLINE
  916. X    Usage    : forline var filename command
  917. X    or    : forline var filename "command;command..."
  918. X    Example    : forline i RAM:temp "echo line $_linenum=$i"
  919. X
  920. X    For each ASCII line of file specified commands are executed and
  921. X    var points to line content. You can check system variable _linenum
  922. X    to find the number of the line currently read.
  923. X
  924. X    FORNUM
  925. X    Usage    : fornum [-v] var n1 n2 command
  926. X    or    : fornum [-v] -s var n1 n2 step command
  927. X    Example    : fornum -v x 1 10 echo $1
  928. X    or    : fornum -s x 10 1 -1 echo $i # counts backwards
  929. X
  930. X    Executes  command(s)  for  all numerical values of x between n1 and
  931. X    n2.   If  more  than  one  command  is  specified,  or  command  is
  932. X    redirected, include command(s) in quotes.
  933. X    Switch -v (verbose) causes printing of progressive numbers.
  934. X    Switch  -s  allows  you to specify a step; if this is negative, the
  935. X    count will be backwards.
  936. X
  937. X    GETENV
  938. X    Usage    : getenv [shellvar] envvar
  939. X
  940. X    Gets the value of an ARP or ENV: variable (ARP list searched first)
  941. X    and stores it in the shell variable 'shellvar'. If shellvar is
  942. X    omitted, the value of the ENV: variable is printed to stdout.
  943. X
  944. X    GOTO
  945. X    Usage    : goto label
  946. X    Example    :
  947. X          label start
  948. X            echo "At start"
  949. X            dir ram:
  950. X            goto start
  951. X
  952. X    Goto  the specified label name.  You can only use this command from
  953. X    a  source  file.   Labels  may  be  forward or reverse from current
  954. X    position. It is legal to jump out of if's.
  955. X
  956. X    HEAD
  957. X    Usage    : head filename [num]
  958. X    Example    : head readme 20
  959. X
  960. X    Display  first "num" lines of "filename".  If num is not specified,
  961. X    10 is assumed.
  962. X
  963. X    HELP
  964. X    Usage    : help
  965. X    Example    : help
  966. X
  967. X    Simply  displays  all  the  available  commands.   The commands are
  968. X    displayed in search-order.  That is, if you give a partial name the
  969. X    first  command  that  matches  that  name  in  this list is the one
  970. X    executed.   Generally,  you  should  specify enough of a command so
  971. X    that it is completely unique.
  972. X
  973. X    HISTORY
  974. X    Usage    : history [partial_string]
  975. X    Example    : history
  976. X
  977. X    Displays  the  enumerated  history  list.   The size of the list is
  978. X    controlled  by  the  _history  variable.   If you specify a partial
  979. X    string, only those entries matching that string are displayed.
  980. X
  981. X    HOWMANY
  982. X    Usage    : howmany
  983. X
  984. X    This  command  tells you how many instances of Shell are running in
  985. X    your system.
  986. X
  987. X    HTYPE
  988. X    Usage    : htype file1 .. filen
  989. X
  990. X    Displays the specified files in hex and ASCII, just like the system
  991. X    command Type file opt h.  Especially suitable for binary files.
  992. X
  993. X    IF
  994. X    Usage    : if [-n] argument conditional argument ;
  995. X    or    : if [-n] argument
  996. X    or    : if [-n] -f file
  997. X    or    : if [-n] -d file/dir
  998. X    or    : if [-n] -m
  999. X    or    : if [-n] -t file file1 .. fileN
  1000. X    or    : if [-n] -r rpnexpression
  1001. X    or    : if [-n] -v varname
  1002. X
  1003. X    If a single argument is something to another argument.  Conditional
  1004. X    clauses allowed:
  1005. X
  1006. X    <, >, =, and combinations (wire or).  Thus <> is not-equal, >=
  1007. X    larger or equal, etc...
  1008. X
  1009. X    If arguments are not numeric, they are compared as strings.
  1010. X
  1011. X    Usually the argument is either a constant or a variable ($varname).
  1012. X
  1013. X    The second form if IF is conditional on the existance of the argument.
  1014. X    If the argument is a "" string, then FALSE, else TRUE.
  1015. X
  1016. X    The third form of IF used by -f switch checks for existance of
  1017. X    the specified file.
  1018. X
  1019. X    Switch -d tests the type of the object specified: if it is a
  1020. X    directory, then TRUE; if it is a file (or it doesn't exist)
  1021. X    then FALSE.
  1022. X
  1023. X    Switch -m is used to test if FAST memory is present.
  1024. X    Example (to be included in a login.sh file):
  1025. X    if -m; resident -d lc1 lc2 blink; endif
  1026. X
  1027. X    Using -t form compares the date and time of the first file with
  1028. X    all the others; if the first is younger than ALL the others, then
  1029. X    FALSE, else TRUE. If a file doesn't exists, it is considered as
  1030. X    being older.
  1031. X    This feature is especially useful for building makefiles without
  1032. END_OF_FILE
  1033. if test 34966 -ne `wc -c <'shell.doc.aa'`; then
  1034.     echo shar: \"'shell.doc.aa'\" unpacked with wrong size!
  1035. fi
  1036. # end of 'shell.doc.aa'
  1037. fi
  1038. echo shar: End of archive 6 \(of 6\).
  1039. cp /dev/null ark6isdone
  1040. MISSING=""
  1041. for I in 1 2 3 4 5 6 ; do
  1042.     if test ! -f ark${I}isdone ; then
  1043.     MISSING="${MISSING} ${I}"
  1044.     fi
  1045. done
  1046. if test "${MISSING}" = "" ; then
  1047.     echo You have unpacked all 6 archives.
  1048.     rm -f ark[1-9]isdone
  1049. else
  1050.     echo You still need to unpack the following archives:
  1051.     echo "        " ${MISSING}
  1052. fi
  1053. ##  End of shell archive.
  1054. exit 0
  1055. -- 
  1056. Mail submissions (sources or binaries) to <amiga@uunet.uu.net>.
  1057. Mail comments to the moderator at <amiga-request@uunet.uu.net>.
  1058. Post requests for sources, and general discussion to comp.sys.amiga.misc.
  1059.